package com.lkbaby.abstract1;

import com.lkbaby.abstract1.impl.FastFactory;
import com.lkbaby.abstract1.impl.GoodFactory;

public interface AbstractFactory {

	HtmlDocument createHtml(String md);

	WordDocument createWord(String md);

	static AbstractFactory createFactory(String name) {
		if (name.equalsIgnoreCase("fast")) {
			return new FastFactory();
		} else if (name.equalsIgnoreCase("good")) {
			return new GoodFactory();
		} else {
			throw new IllegalArgumentException("Invalid factory name");
		}
	}
}